package nextoffer.Tencent2;

import java.util.PriorityQueue;
import java.util.Scanner;

public class Second {
    public static void main(String[] args) {
        int n,k;
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        k = in.nextInt();
        long [] arr = new long[n];
        PriorityQueue<Long> priorityQueue = new PriorityQueue<Long>((a,b) -> (int) (a - b));
        for(int i = 0 ;i < n; i ++) {
            arr[i] = in.nextLong();
            priorityQueue.add(arr[i]);
        }
        while(k-- >0) {
            Long poll = priorityQueue.poll();
            if(poll %2 ==0){
                poll = poll * 2 + 1;
            } else {
                poll = poll * 2;
            }
            priorityQueue.add(poll);
        }
        System.out.println(priorityQueue.stream().mapToInt(Long::intValue).sum());


    }
}
